package net.yihang.miaosha.util;

import org.apache.commons.codec.digest.DigestUtils;

public class Md5Util {

    public static String toFormPass(String password, String salt) {
        return DigestUtils.md5Hex(password + salt);
    }

    public static String toDbPass(String formPass, String salt) {
        return DigestUtils.md5Hex(formPass + salt);
    }

    public static boolean verifyDbPass(String formPass, String salt, String dbPass) {
        return toDbPass(formPass, salt).equals(dbPass);
    }

}
